﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
        <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
            <c:set var="ctx" value="${pageContext.request.contextPath}" />
            <html>

            <head>
                <link rel="stylesheet" href="${ctx}/common/common.css">
                <title>Title</title>
                <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/layui/css/layui.css" media="all">
                <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/style/admin.css" media="all">
                <script src="${ctx}/common/plugins/layuiadmin/layui/layui.js"></script>

                <script src="${ctx}/common/plugins/jquery-1.10.2.min.js"></script>
            </head>

            <body>
                <form class="layui-form" action="${ctx}/department/saveDepartment">
                    <input type="hidden" name="id" value="${department.id}" />
                    <div class="layui-form-item layui-col-md5" style="margin-top: 50px">
                        <label class="layui-form-label">部门名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" value="${department.name}" lay-verify="required"
                                autocomplete="on" class="layui-input" readonly>
                        </div>
                    </div>
                    <div class="layui-form-item layui-col-md5">
                        <label class="layui-form-label">部门描述</label>
                        <div class="layui-input-block">
                            <input type="text" name="described" value="${department.described}" lay-verify="required"
                                autocomplete="on" class="layui-input" readonly>
                        </div>
                    </div>
                    <div class="layui-form-item layui-col-md5">
                        <label class="layui-form-label">创建时间</label>
                        <div class="layui-input-block">
                            <input type="text" name="described"
                                value="<fmt:formatDate value='${department.createTime}' pattern=" yyyy-MM-dd" />"
                            lay-verify="required" autocomplete="on"
                            class="layui-input" readonly>
                        </div>
                    </div>
                    <div class="layui-form-item layui-col-md5">
                        <label class="layui-form-label">创建人</label>
                        <div class="layui-input-block">
                            <input type="text" name="described" value="${department.creatorName}" lay-verify="required"
                                autocomplete="on" class="layui-input" readonly>
                        </div>
                    </div>
                    <div class="layui-form-item layui-col-md5">
                        <label class="layui-form-label">父级部门</label>
                        <div class="layui-input-block">
                            <input readonly id="dept" lay-type="showPerson" disabled value="${parentDept.name}"
                                autocomplete="off" class="layui-input" readonly>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="button" id="rollback" class="layui-btn layui-btn-primary">返回</button>
                        </div>
                    </div>
                </form>
            </body>
            <script>
                document.getElementById("rollback").addEventListener("click", function () {
                    window.history.back();
                })
            </script>

            </html>